package com.hucsmn.xcopy;

import java.io.IOException;
import java.util.List;

/**
 * 多线程文件复制异常收集容器。
 */
public class MultiThreadCopyException extends IOException {
    private static final long serialVersionUID = 922586126155995327L;

    public List<Throwable> failures;

    MultiThreadCopyException() {
        super();
    }

    MultiThreadCopyException(String message) {
        this(message, List.of());
    }

    MultiThreadCopyException(String message, Throwable cause) {
        this(message, List.of(cause));
    }

    MultiThreadCopyException(Throwable cause) {
        this(String.valueOf(cause), List.of(cause));
    }

    MultiThreadCopyException(String message, List<Throwable> failures) {
        super(message);
        this.failures = failures;
    }
}
